<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="zh-CN"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.js"></script>
	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
	<script type="text/javascript" src="https://raw.github.com/HPNeo/gmaps/master/gmaps.js"></script>
    <script type="text/javascript">
		var map;
		$(document).ready(function(){
		
			map = new GMaps({
				div: '#map',
				lat: 35.2193612,
				lng: 113.2482923
			});
		
			$("#btn").click(function(){
				$("#map").slideToggle(1000,function(){
					var v= $("#btn").val();	
					if("显示地图"==v){
						$("#btn").val("关闭地图");
					}else{
						$("#btn").val("显示地图");
					}
				});
				
				GMaps.geocode({
					address: $('#address').val(),
					callback: function(results, status) {
						if (status == 'OK') {
							var latlng = results[0].geometry.location;
							map.setCenter(latlng.lat(), latlng.lng());
							map.addMarker({
								lat: latlng.lat(),
								lng: latlng.lng()
							});
						}
					}
				});
			});
		});
    </script>
</head>
<body class="body">
	<jsp:include page="include/head.jsp">
		<jsp:param value="${ep}" name="ep"/>
	</jsp:include>
	
	<div class="container">
	  <div class="row">
		<div class="span3">
			<div style="padding: 8px 0;" class="well">
				<jsp:include page="include/nav.jsp">
					<jsp:param value="connecter" name="tag"/>
				</jsp:include>
			</div>
		</div>
		<div class="span9">
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0">
				<li class="active">
					<a href="contact.jspx"><i class="icon-user"></i>联系人</a>
				</li>
			</ul>
			<div class="wall">
				<address>
					
					<h3>${contact.name}</h3>
					<p>公司：${contact.companyname}</p>
					<small>手机</small> ${contact.mobile}<br>
					<small>固话</small> ${contact.tel}<br><br>
					<small>邮箱</small> ${contact.email}<br>
					<small>主页</small> <a href="${contact.website}">${contact.website}</a><br>
					<small>微博</small> <a href="${contact.weibo}">${contact.weibo}</a><br>
					
					<small>地址</small>
					<input type="text" name="" style="margin-top:5px;" id="address" readonly="readonly" value=" ${contact.address}"/>
					<input type="button" class="btn" value="显示地图" id="btn" /><br>
					<div id="map" style="margin-left:80px;display:none;width:500px;height:500px">
					
					<div class="controls">
			            <label class="control-label" for="input01">简介：</label>
			            <div class="controls">
			              <textarea class="span5" readonly="readonly" rows="3" name="content">${contact.content}</textarea>
			            </div>
			        </div>
				</address>
			
				<div class="line">添加记录：</div>
					<form action="contact.jspx" method="post">
						<input type="hidden" name="id" value="${contact.id}">
						<input type="hidden" name="m" value="addContactNote">
						<textarea class="span5" rows="3" name="content"></textarea>
						<br>
						<button type="submit" class="btn">发布</button>
					</form>
					<c:if test="${fn:length(contactNoteList) == 0 }">
							<blockquote>
							 	没有记录！
							</blockquote>
					</c:if>
					<c:forEach items="${contactNoteList}" var = "contactNote">
						<blockquote>
							  ${contactNote.content};
							  <small>${ep.e.name}发布于${contactNote.tiptime }
							  </small>
						</blockquote>
						
					</c:forEach>	
					<a href="contact.jspx?id=${contact.id}">←返回联系人列表</a>
			</div>
		</div>
	  </div>
	</div>
</body></html>